genactcodecompoparam

SoftwareShield COM-Activator™ Component > COM-Activator™ Reference > GenActCodeCompoParam

## GenActCodeCompoParam

The GenActCodeCompoParam function generates an Activation Code from a specified Authorization Request Code for a specific license project file. The Authorization Definition to generate the Activation Code for must take a (run-time) composite parameter.

###### Syntax

HRESULT GenActCodeCompoParam (

BSTR LPJFileNamePath,

BSTR AuthorizationRequestCode,

long EmbedCompositeDefinitions,

long OverrideShelfLife,

long OverrideAuthID,

BSTR * ActivationCode,

long * ACG_return_code

);

###### Parameters

LPJFileNamePath

[IN] This is a wide string value that indicates the full path and filename of the license project file to use to generate the Activation Code. The file must exist and must be an .LPJ file.

AuthorizationRequestCode

[IN] This is a wide string value that must contain the Authorization Request Code for which you wish to generate an Activation Code. Note that the Authorization Request Code you pass must represent a type that expects a numeric parameter. See remarks below for more information.

EmbedCompositeDefinitions

[IN] This is a value that contains the composite parameter you wish to embed in the generated Activation Code. It must be within the range of a 16-bit unsigned value (0x0 to 0xFFFF inclusive). Each bit of the parameter represents one definition in the license project. The least significant bit represents definition ID #0 and the most significant bit represents definition #15. See remarks for more information.

OverrideShelfLife

[IN] This is a numeric value that contains a value to use to override the default Shelf-Life of the corresponding Authorization Definition. If you wish to use the default Shelf-Life for the corresponding definition, use the value negative one (-1). Otherwise use zero (0) to turn off the Shelf-Life feature or a positive value to use for the number of days that the Shelf-Life will last. See remarks below for more information.

OverrideAuthID

[IN] This is a numeric value that contains a value to use to override the Authorization Definition for which you will generate an Activation Code. If you wish to use the Authorization Definition to which the Authorization Request Code directly corresponds, use the value -1. Otherwise use the Authorization ID that you wish to use to override the request. See remarks below for more information.

ActivationCode

[OUT] This is (a pointer to) a wide string value that returns with holding the Activation Code if the function call is successful.

ACG_return_code

[OUT] This is (a pointer to) a numeric value that returns with a ACG_RETURN_CODE that identifies the outcome of the operation. See remarks below for more information.

###### Remarks

Use GenActCodeCompoParam to generate an Activation Code from a specified Authorization Request Code and license project file which takes a (run-time) composite parameter.

You can pre-determine if an Authorization Request Code takes a numeric parameter by first calling the DecodeARC function and inspecting its AuthParamType parameter.

The EmbedCompositeDefinitions parameter you pass to this function is a bit-field. It must be within the range of a 16-bit unsigned value (0x0 to 0xFFFF inclusive). Each bit of the parameter represents one definition in the license project. The least significant bit represents definition ID #0 and the most significant bit represents definition #15.

For example, to generate a composite Activation Code that will activate definitions 0, 1, 3, and 7; we must construct a parameter value that has each of these bits turned on. In binary, this is equal to value 10001011, which is equal to decimal value 139. So we would pass value 139 in the EmbedCompositeDefinitions parameter to generate an Activation Code that will activate these definitions on the clients machine.

The ACG_return_code parameter will return holding ACG_FALSE_MISSING_MAIN_LF if the LPJFileNamePath parameter does not indicate a file that exists. If the license project file exists, but is an invalid filename, it returns holding ACG_FALSE_BAD_MAIN_LF_FILENAME. If the License project exists and seems to be the correct format but an error occurred during loading it returns holding ACG_FALSE_MAIN_LF_CORRUPT.

The ACG_return_code parameter will return holding ACG_FALSE_CODE_BAD_FORMAT if the Authorization Request Code passed is invalid.

The ACG_return_code parameter will return holding ACG_FALSE_CODE_INVALID_BAD_ID if the Authorization Request Code corresponds to an Authorization ID that is not valid for the license OR if you specify an override Authorization ID other than -1 in OverrideAuthID that is not valid for the license.

The ACG_return_code parameter will return holding ACG_FALSE_PARAM_OUT_OF_RANGE if the EmbedCompositeDefinitions parameter is not in the valid range (16-bit unsigned).

The ACG_return_code parameter will return holding ACG_FALSE_WRONG_PARAM_TYPE if the Authorization Request Code corresponds to an Authorization Definition which does not take a (run-time) composite parameter.

The ACG_return_code parameter will return holding ACG_FALSE_SHELF_LIFE_OUT_OF_RANGE if the OverrideShelfLife parameter contains an invalid value. (Any value less than -1).

The ACG_return_code parameter will return holding ACG_FALSE_DEACTIVATION_ID_ONLY if the Authorization Request Code is actually a Deactivation Confirmation Code. (Activation Codes are never generated for Deactivation Confirmation Codes).

The ACG_return_code parameter will return holding ACG_TRUE_ACT_CODE_GENERATED if an Activation Code was successfully generated. In which case, the ActivationCode parameter will return holding the Activation Code itself.

###### Return Value

As with all COM function calls they return an HRESULT. HRESULT is a data type that is a 32-bit error or warning code. Check your compilers documentation for information on interpreting the HRESULT value.

###### Function Information

Exposed By Interface: | "ISSCodeGenerator"
Exposed In COM Server Binary: | "SSCGen.dll"

Note: The COM Activator only comes with the Enterprise, Internet and Server Editions of the SoftwareShield DRM Kit.